package com.zw.mizhe.model.impl;

import com.cpoopc.retrofitrxcache.RxCacheResult;
import com.zw.mizhe.api.ApiServiceManager;
import com.zw.mizhe.bean.base.BaseDataEntity;
import com.zw.mizhe.model.ISplashModel;

import rx.Observable;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

/**
 * Created by zhangwei on 16/10/21.
 */

public class SplashModelImpl implements ISplashModel {

    @Override
    public void loadBaseData(Subscriber<RxCacheResult<BaseDataEntity>> subscriber) {
        Observable<RxCacheResult<BaseDataEntity>> observable = ApiServiceManager.getInstance()
                .getBaseDataService()
                .loadBaseData();
        observable.observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io())
                .subscribe(subscriber);


    }
}
